<?php

namespace App\Library\Logic;

use App\Library\Model\DemoModel;
use App\Library\Requests\Demo\DemoPageRequest;

class DemoLogic extends DemoModel
{
    /**
     * Desc paging
     *
     * @param DemoPageRequest $request
     * @return array
     */
    public function paging(DemoPageRequest $request): array
    {
        return paginate(helpBuilder($this->newQuery(), $request)->paginate($request->limit, [
            'id',
            'serial_number',
            'switch',
            'title',
            'quantity',
            'remark',
            'created_at',
        ]));
    }
}
